/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Vista;

import Bussinnes.UlaboralBLLocal;
import Model.Ulaboral;
import Model.Usuarios;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author jose
 */
@ManagedBean(name="ULaboralBean")
@SessionScoped
public class ULaboralBean {
    @EJB
    private UlaboralBLLocal ulaboralBL;
    private Ulaboral ul;


    /** Creates a new instance of ULaboralBean */
    public ULaboralBean() {
        FacesContext fc = FacesContext.getCurrentInstance();
        Usuarios u=(Usuarios) fc.getExternalContext().getSessionMap().get("USUARIO");
        ul=new Ulaboral();
        ul.setNocontrol(Integer.parseInt(u.getControl()));
    }

    public Ulaboral getUl() {
        return ul;
    }

    public void setUl(Ulaboral ul) {
        this.ul = ul;
    }

    public String procesarPeticion(){
        ulaboralBL.registrarUlaboral(ul);
        return "CompetenciasLaborales";
    }

}
